Package com.netscape.cms.password
Class PasswordChecker
java.lang.Object
com.netscape.cms.password.PasswordChecker
This class checks the given password if it meets the specific requirements.
For example, it can also specify the format of the password which has to
be 8 characters long and must be in alphanumeric.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.PasswordChecker
(int minSize, int minUpperLetter, int minLowerLetter, int minNumber, int minSpecialChar, int seqLength, int maxRepeatedChar, boolean cracklibCheck) -
Method Summary
Modifier and TypeMethodDescriptionint
int
int
int
int
int
Returns a reason if the password doesn't meet the quality requirement.Returns a reason if the password doesn't meet the quality requirement.int
boolean
boolean
isGoodPassword
(String pwd) Returns true if the given password meets the quality requirement; otherwise returns false.void
setCracklibCheck
(boolean cracklibCheck) void
setMaxRepeatedChar
(int maxRepeatedChar) void
setMinLowerLetter
(int minLowerLetter) void
setMinNumber
(int minNumber) void
setMinSize
(int minSize) void
setMinSpecialChar
(int minSpecialChar) void
setMinUpperLetter
(int minUpperLetter) void
setSeqLength
(int seqLength)
-
Constructor Details
-
PasswordChecker
public PasswordChecker()Default constructor. -
PasswordChecker
public PasswordChecker(int minSize, int minUpperLetter, int minLowerLetter, int minNumber, int minSpecialChar, int seqLength, int maxRepeatedChar, boolean cracklibCheck)
-
-
Method Details
-
isGoodPassword
Returns true if the given password meets the quality requirement; otherwise returns false.- Parameters:
pwd
- The given password being checked.- Returns:
- true if the password meets the quality requirement; otherwise returns false.
- Throws:
EPasswordCheckException
- If there is a configuration problem with the password checker
-
getReason
Returns a reason if the password doesn't meet the quality requirement.- Returns:
- string as a reason if the password quality requirement is not met.
-
getReason
Returns a reason if the password doesn't meet the quality requirement.- Parameters:
loc
-- Returns:
- string as a reason if the password quality requirement is not met.
-
getMinSize
public int getMinSize() -
setMinSize
public void setMinSize(int minSize) -
getMinUpperLetter
public int getMinUpperLetter() -
setMinUpperLetter
public void setMinUpperLetter(int minUpperLetter) -
getMinLowerLetter
public int getMinLowerLetter() -
setMinLowerLetter
public void setMinLowerLetter(int minLowerLetter) -
getMinNumber
public int getMinNumber() -
setMinNumber
public void setMinNumber(int minNumber) -
getMinSpecialChar
public int getMinSpecialChar() -
setMinSpecialChar
public void setMinSpecialChar(int minSpecialChar) -
getSeqLength
public int getSeqLength() -
setSeqLength
public void setSeqLength(int seqLength) -
getMaxRepeatedChar
public int getMaxRepeatedChar() -
setMaxRepeatedChar
public void setMaxRepeatedChar(int maxRepeatedChar) -
isCracklibCheck
public boolean isCracklibCheck() -
setCracklibCheck
public void setCracklibCheck(boolean cracklibCheck)
-